package com.example.normal.mapper;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.base.mapper.ExtBaseMapper;
import com.example.normal.entity.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wahoyu
 * @since 2023-07-23
 */
public interface StudentMapper extends ExtBaseMapper<Student> {

    @Select("select * from student where id = #{id}")
    JSONObject getOneJsonObj(@Param("id")BigInteger id);

    @Select("select * from student")
    List<JSONObject> getJsonObjList();

    @Select("select * from student where id = #{id}")
    Map<String,Object> getOneMap(@Param("id")BigInteger id);

    @Select("select * from student")
    List<Map<String,Object>> getMapList();

    IPage<Student> testStudentPage(@Param("student")Student student, @Param("page")Page<Student> page);

    JSONObject testJSONObject(Student student);
}
